package com.unknowpupil.web.component.wallet.scheduled;

import com.google.common.collect.Maps;
import com.unknowpupil.web.component.qrzt.BaseSchedulerJop;
import com.unknowpupil.web.component.wallet.entity.Market;
import com.unknowpupil.web.component.wallet.tools.CoinMarketTools;
import com.unknowpupil.web.component.wallet.utils.HttpClientResult;
import com.unknowpupil.web.component.wallet.utils.HttpClientUtils;
import com.unknowpupil.web.utils.MapperUtils;
import org.apache.commons.lang3.StringUtils;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @Classname: CoinMarketTools
 * @Author: <a> w10g </a>
 * @CreateDate: Create in 2019/10/19 1:26
 * @Description:
 * # 获取已开启的市场信息，包括价格、数量小数点位数
 * TPL_MARKETS = 'http://api.zb.com/data/v1/markets'
 * # 全币种行情
 * TPL_ALL_MARKET = 'http://api.zb.cn/data/v1/allTicker'
 * # 行情
 * TPL_MARKET = 'http://api.zb.com/data/v1/ticker?market={MARKET}'
 * # 市场深度
 * TPL_DEPTH = 'http://api.zb.com/data/v1/depth?market={MARKET}&size={SIZE}'
 * # 历史成交
 * TPL_TRADES = 'http://api.zb.com/data/v1/trades?market={MARKET}'
 * # k线
 * TPL_KLINE = 'http://api.zb.com/data/v1/kline?market={MARKET}'
 * @Version: 1.0
 */
@Component
public class CoinMarketScheduled  implements BaseSchedulerJop {
  private   final  static Logger logger = LoggerFactory.getLogger(CoinMarketScheduled.class);
    @Autowired
    CoinMarketTools coinMarketTools;
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        logger.info("行情任务开始->{}",context);
        Market eth = coinMarketTools.getMarket("ETH");

//          logger.info(eth);
//          logger.info(eth.getTicker().getBuy());
    }
}
